<?php

namespace EasyVote\EasyVoteBundle\Entity;

use Knp\DoctrineBehaviors\Model as ORMBehaviors;


use Doctrine\ORM\Mapping as ORM;

/**
 * Stores the degree that a user is pursuing. Example: BS in Computer Science from the CSE department.
 * @ORM\Entity()
 */
class Degree
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * The department that issues the degree
     * @var Department
     * @ORM\ManyToOne(targetEntity="Department")
     */
    protected $department;

    /**
     * The type of the degree (like BS, BA, MS, PhD)
     * @var DegreeType
     * @ORM\ManyToOne(targetEntity="DegreeType")
     */
    protected $type;

    /**
     * The field of the degree, such as "Computer Science"
     * @var
     * @ORM\Column(name="field", type="string")
     */
    protected $field;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set department
     *
     * @param Department $department
     * @return Degree
     */
    public function setDepartment($department)
    {
        $this->department = $department;

        return $this;
    }

    /**
     * Get department
     *
     * @return Department
     */
    public function getDepartment()
    {
        return $this->department;
    }

    /**
     * Set type
     *
     * @param DegreeType $type
     * @return Degree
     */
    public function setType($type)
    {
        $this->type = $type;
    }

    /**
     * Sets the field
     * @param $field
     */
    public function setField($field)
    {
        $this->field = $field;

    }

    /**
     * Get type
     *
     * @return DegreeType
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Gets the field
     * @return mixed
     */
    public function getField()
    {
        return $this->field;
    }

    /**
     * Gets the display name.
     * @return string
     */
    public function getDisplayName () {
		return $this->getType()->getName().' '.$this->getField();
	}
}
